#导入通讯录
from time import sleep
from selenium.webdriver.common.by import By
from auto_frame.base import Base
class ImportContactPage(Base):

    ele_file_upload = (By.CSS_SELECTOR,".ww_fileImporter_fileContainer_uploadInputMask")
    ele_file_upload_name = (By.CSS_SELECTOR, ".ww_fileImporter_fileContainer_fileNames")
    ele_import_contact = (By.CSS_SELECTOR, '.qui_btn.ww_btn.ww_btn_Large.ww_btn_Blue.ww_fileImporter_submit')

    #文件导入
    def file_import(self,datafile):
        #from page.contact_page import ContactPage
        self.find_element(self.driver, self.ele_file_upload).send_keys(datafile)
        sleep(5)
        file_name = self.find_element(self.driver, self.ele_file_upload_name).text
        self.find_element(self.driver, self.ele_import_contact).click()
        return file_name

    #腾讯企业通讯录导入（因为没有账号，先占个坑，后续看有没有办法完善
    def tx_ent_contact_import(self):
        pass